package com.itheima.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.itheima.dao.AreaRepository;
import com.itheima.domain.Area;
import com.itheima.service.AreaService;

@Service
@Transactional
public class AreaServiceImpl implements AreaService {

	@Autowired
	private AreaRepository AreaRepository;
	
	

	@Override
	public void saveArea(List<Area> areas) {
		// TODO Auto-generated method stub
		AreaRepository.save(areas);
	}



	@Override
	public Page<Area> findPageData(Specification<Area> specification,
			Pageable pageable) {
		// TODO Auto-generated method stub
		return AreaRepository.findAll(specification, pageable);
	}


}
